<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title> 个人信息</title>
</head>
<style>

  span.error{
     color:#4169E1;
  }
  .gr{
     width: 320px; 
     height: 400px;
     margin: 0 auto;
     font-size:20px;
  }

  .input{
     border:1px solid #aaa;
     background:#FFFFFF;
  }

</style>
<body>
 <form method="POST" th:action="@{/personal}" th:object="${im}">
  <h1 align="center">个人信息</h1>
  <div class="gr">
  
    <br>
    <label for="name">姓名: </label>
    <input type="text" th:field="*{name}" name="name" />
    <span class="error"
            th:if="${#fields.hasErrors('name')}"
            th:errors="*{name}">Name Error</span>
    <br><br><br>
    <label for="sex">性别: </label>
    <input type="text" th:field="*{sex}" name="sex"/>
    <span class="error"
            th:if="${#fields.hasErrors('sex')}"
            th:errors="*{sex}">Sex Error</span>
    <br><br><br>
    <label for="age">年龄: </label>
    <input  type="text" th:field="*{age}" name="age"/>
    <span class="error"
              th:if="${#fields.hasErrors('age')}"
            th:errors="*{age}">Age Error</span>
            <br><br><br>
            <label for="no">学号: </label>
    <input  type="text" th:field="*{no}" name="no"/>
    <span class="error"
            th:if="${#fields.hasErrors('no')}"
            th:errors="*{no}">No Error</span>
    <br>
   
    <input class="input" type="submit" value="提交"/>
 </div>
  <br>
 </form>
</body>
</html>